package com.rbac.infrastructure.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.rbac.domain.entity.UserRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserRoleMapper extends BaseMapper<UserRole> {

    void deleteByUserId(@Param("userId") Long userId);

    void deleteByUserIds(@Param("userIds") List<Long> userIds);

    void deleteByRoleId(@Param("roleId") Long roleId);

    void insertBatch(@Param("userRoles") List<UserRole> userRoles);

    List<Long> getRoleIdsByUserId(@Param("userId") Long userId);
}